<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" />
<xsl:template match="/">
<xsl:if test="Schema/@IsDropCode='1'">
if exists (select * from dbo.sysobjects where id = object_id(N'[_<xsl:value-of select="Schema/@TableName" />SelectAll]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [_<xsl:value-of select="Schema/@TableName" />SelectAll]
GO
</xsl:if>
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
--获取表<xsl:value-of select="Schema/@TableName" />的所有记录。请勿修改此存储过程，如果需要特殊的选择方法，请另写存储过程。
CREATE PROCEDURE _<xsl:value-of select="Schema/@TableName" />SelectAll<xsl:if test="Schema/@IsEncrypt='1'">
	WITH ENCRYPTION
	</xsl:if>
AS
SELECT * FROM [<xsl:value-of select="Schema/@Owner" />].[<xsl:value-of select="Schema/@TableName" />] <xsl:if test="Schema/@IsNoLock='1'">  WITH(NOLock)</xsl:if>
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
</xsl:template>
</xsl:stylesheet>